package com.liang.objects;


import java.util.Objects;

public class ObjecsDemo {
    public static void main(String[] args) {


        Student stu = new Student("小明",18);

        String s = Objects.toString(stu);
        System.out.println(s);

        Student stu1 = null;
        String result = Objects.toString(stu1, "随便打印");
        System.out.println(result);

        System.out.println(Objects.isNull(stu1));
        System.out.println(Objects.isNull(stu));
        System.out.println(Objects.nonNull(stu));
        System.out.println(Objects.nonNull(stu1));
    }


}
